import request from '@/utils/request'

// 获取销售量数据
export function getSaleData(data) {
  return request({
    url: '/api/order-service/report/orderCount',
    params: data
  })
}

// 获取销售额数据
export function getSaleMoneyData(data) {
  return request({
    url: '/api/order-service/report/orderAmount',
    params: data
  })
}

// 获取补货次数
export function getReplenishData(innerCode, start, end) {
  return request({
    url: `/api/task-service/task/supplyCount/${innerCode}/${start}/${end}`
  })
}

// 获取维修次数
export function getRepairData(innerCode, start, end) {
  return request({
    url: `/api/task-service/task/repairCount/${innerCode}/${start}/${end}`
  })
}

// 获取查看详情的商品数量
export function getDetailData(innerCode, start, end) {
  return request({
    url: `/api/order-service/report/skuCollect/${innerCode}/${start}/${end}`
  })
}

export const getDeviceList = (data) => {
  return request({
    url: '/api/vm-service/vm/search',
    method: 'get',
    params: data
  })
}

export const vmStatusYs = {
  0: '未投放',
  1: '运营',
  3: '撤机'
}
